package com.example.student.service.impl;

import com.example.student.mapper.StudentMapper;
import com.example.student.pojo.Student;
import com.example.student.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-11-14
 * Time: 20:03
 */
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    StudentMapper studentMapper;
    @Override
    public List<Student> getAllStudentByScore() {
        return studentMapper.getAllStudentByScore();
    }

    @Override
    public List<Integer> getStudentCount(Integer grade) {
        return studentMapper.getStudentCount(grade);
    }

    @Override
    public List<Student> getAllStudentByName(String name) {
        return studentMapper.getAllStudentByName("%"+name+"%");
    }
}
